BIN:=test
CC:=g++
SRC:=$(wildcard *.cpp)
OBJ:=$(SRC:.cpp=.o)
LFLAGS:=-o
FLAGS:=-c -g
RM:=rm -rf

$(BIN):$(OBJ)
	@$(CC) $(LFLAGS) $@ $^
	@echo "linking ... $^ to $@"
%.o:%.cpp
	@$(CC) $(FLAGS) $<
	@echo "compling ... $< to $@"
.PHONY:clean
clean:
	@$(RM) $(BIN)

